package com.tianqu.tms.www.cardect.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.tianqu.tms.core.base.Logger;
import com.tianqu.tms.core.base.TmsAction;
import com.tianqu.tms.core.base.UserContext;
import com.tianqu.tms.core.util.StringUtil;
import com.tianqu.tms.core.util.TmsConstants;
import com.tianqu.tms.entity.TmsDetectPic;
import com.tianqu.tms.www.cardect.actionform.TisDetectSeniorActionForm;
import com.tianqu.tms.www.cardect.viewhelper.CarSeniorDetectInputViewHelper;
import com.tianqu.tms.www.cardect.viewhelper.CarSeniorDetectViewHelper;
/**
 * 
 *  高级检测录入确认页
 * 
 * @author tianshifu
 *
 */
public class CarWCSeniorDetectConfirmAction extends TmsAction {
	private Logger logger = Logger.getLogger(CarWCSeniorDetectConfirmAction.class);//log
	private static final String DETECT_POSITION = "detect_position";//检测位置，标识哪个button提交
	private static final String SENIOR_DETECT_INPUT_DATA = "senior_detect_input_data";//检测录入信息
	public static final String CARSERIAL = "carSerial";
	private static final String IMGLIST = "imgList";//用于存放图片对象的list
	
	@Override
	protected ActionForward doAction(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response,
			UserContext uc) throws Exception {
		logger.debug(this.getClass().getName() + "#execute was called.");		

		//从uc中获取数据参数看是按钮位置 来进行页面跳转判定，并带出相应的值
		//每次都进入到这个Action中 进入到这个页面的时候需要传过来一个位置ID 根据位置ID对对应的选项进行添加
		//每次都需要判断是否为空，为空的话过掉
		//从form中获取页面表单
		TisDetectSeniorActionForm seniorDetectForm = (TisDetectSeniorActionForm)form;		
		CarSeniorDetectInputViewHelper view = new CarSeniorDetectInputViewHelper();//返回的时候需要冲uc中取值
		
		CarSeniorDetectViewHelper topView = (CarSeniorDetectViewHelper)uc.getAttribute(SENIOR_DETECT_INPUT_DATA);

		/********** 评分 *****************/
		 double outwardScore = topView.getOutwardScore();// 车身评分
		 double engineScore = topView.getEngineScore();// 发动机舱评分
		 double pilotScore = topView.getPilotScore();// 驾驶舱评分
		 double startScore = topView.getStartScore();// 启动评分
		 double runScore = topView.getRunScore();// 路试评分
		 double bottomScore = topView.getBottomScore();// 底盘评分
		
		String actionForward = "";//点击不同的按钮跳转到不同的路径
		
//		//向viewhelp中set列表list 包括缺陷程度描述和评分 从字典表中取得
//		Codes code = Codes.getInstance();

		String	position = (String)uc.getAttribute(DETECT_POSITION);
		
		List<TmsDetectPic> list = (List<TmsDetectPic>)uc.getAttribute(IMGLIST);
		if(list!=null)
		{
			//将list中图片信息set到viewhelp中
			for(int i=0;i<list.size();i++)
			{
				TmsDetectPic entity = (TmsDetectPic)list.get(i);
				if(entity.getImgType() == 2)
				{

				//从这里获取图片信息放到viewhelp中
				if(entity.getImgKey().equals("1"))
				{
					view.setImg1(entity.getImgPath());
					topView.setImg1(entity.getImgPath());
				}
				if(entity.getImgKey().equals("2"))
				{
					view.setImg2(entity.getImgPath());
					topView.setImg2(entity.getImgPath());
				}
				if(entity.getImgKey().equals("3"))
				{
					view.setImg3(entity.getImgPath());
					topView.setImg3(entity.getImgPath());
				}
				if(entity.getImgKey().equals("4"))
				{
					view.setImg4(entity.getImgPath());
					topView.setImg4(entity.getImgPath());
				}
				if(entity.getImgKey().equals("5"))
				{
					view.setImg5(entity.getImgPath());
					topView.setImg5(entity.getImgPath());
				}
				if(entity.getImgKey().equals("6"))
				{
					view.setImg6(entity.getImgPath());
					topView.setImg6(entity.getImgPath());
				}
				if(entity.getImgKey().equals("7"))
				{
					view.setImg7(entity.getImgPath());
					topView.setImg7(entity.getImgPath());
				}
				if(entity.getImgKey().equals("8"))
				{
					view.setImg8(entity.getImgPath());
					topView.setImg8(entity.getImgPath());
				}
				if(entity.getImgKey().equals("9"))
				{
					view.setImg9(entity.getImgPath());
					topView.setImg9(entity.getImgPath());
				}
				if(entity.getImgKey().equals("10"))
				{
					view.setImg10(entity.getImgPath());
					topView.setImg10(entity.getImgPath());
				}
				if(entity.getImgKey().equals("11"))
				{
					view.setImg11(entity.getImgPath());
					topView.setImg11(entity.getImgPath());
				}
				if(entity.getImgKey().equals("12"))
				{
					view.setImg12(entity.getImgPath());
					topView.setImg12(entity.getImgPath());
				}
				if(entity.getImgKey().equals("13"))
				{
					view.setImg13(entity.getImgPath());
					topView.setImg13(entity.getImgPath());
				}
				if(entity.getImgKey().equals("14"))
				{
					view.setImg14(entity.getImgPath());
					topView.setImg14(entity.getImgPath());
				}
				if(entity.getImgKey().equals("15"))
				{
					view.setImg15(entity.getImgPath());
					topView.setImg15(entity.getImgPath());
				}
				if(entity.getImgKey().equals("16"))
				{
					view.setImg16(entity.getImgPath());
					topView.setImg16(entity.getImgPath());
				}
				if(entity.getImgKey().equals("17"))
				{
					view.setImg17(entity.getImgPath());
					topView.setImg17(entity.getImgPath());
				}
				if(entity.getImgKey().equals("18"))
				{
					view.setImg18(entity.getImgPath());
					topView.setImg18(entity.getImgPath());
				}
				if(entity.getImgKey().equals("19"))
				{
					view.setImg19(entity.getImgPath());
					topView.setImg19(entity.getImgPath());
				}
				if(entity.getImgKey().equals("20"))
				{
					view.setImg20(entity.getImgPath());
					topView.setImg20(entity.getImgPath());
				}
				if(entity.getImgKey().equals("21"))
				{
					view.setImg21(entity.getImgPath());
					topView.setImg21(entity.getImgPath());
				}
				if(entity.getImgKey().equals("22"))
				{
					view.setImg22(entity.getImgPath());
					topView.setImg22(entity.getImgPath());
				}
				if(entity.getImgKey().equals("23"))
				{
					view.setImg23(entity.getImgPath());
					topView.setImg23(entity.getImgPath());
				}
				if(entity.getImgKey().equals("24"))
				{
					view.setImg24(entity.getImgPath());
					topView.setImg24(entity.getImgPath());
				}
				if(entity.getImgKey().equals("25"))
				{
					view.setImg25(entity.getImgPath());
					topView.setImg25(entity.getImgPath());
				}
				if(entity.getImgKey().equals("26"))
				{
					view.setImg26(entity.getImgPath());
					topView.setImg26(entity.getImgPath());
				}
				if(entity.getImgKey().equals("27"))
				{
					view.setImg27(entity.getImgPath());
					topView.setImg27(entity.getImgPath());
				}
				if(entity.getImgKey().equals("28"))
				{
					view.setImg28(entity.getImgPath());
					topView.setImg28(entity.getImgPath());
				}
				if(entity.getImgKey().equals("29"))
				{
					view.setImg29(entity.getImgPath());
					topView.setImg29(entity.getImgPath());
				}
				if(entity.getImgKey().equals("30"))
				{
					view.setImg30(entity.getImgPath());
					topView.setImg30(entity.getImgPath());
				}
				if(entity.getImgKey().equals("31"))
				{
					view.setImg31(entity.getImgPath());
					topView.setImg31(entity.getImgPath());
				}
				if(entity.getImgKey().equals("32"))
				{
					view.setImg32(entity.getImgPath());
					topView.setImg32(entity.getImgPath());
				}
				if(entity.getImgKey().equals("33"))
				{
					view.setImg33(entity.getImgPath());
					topView.setImg33(entity.getImgPath());
				}
				if(entity.getImgKey().equals("34"))
				{
					view.setImg34(entity.getImgPath());
					topView.setImg34(entity.getImgPath());
				}
				}
			}
		}else
		{
			view.setImg1("");
			view.setImg2("");
			view.setImg3("");
			view.setImg4("");
			view.setImg5("");
			view.setImg6("");
			view.setImg7("");
			view.setImg8("");
			view.setImg9("");
			view.setImg10("");
			view.setImg11("");
			view.setImg12("");
			view.setImg13("");
			view.setImg14("");
			view.setImg15("");
			view.setImg16("");
			view.setImg17("");
			view.setImg18("");
			view.setImg19("");
			view.setImg20("");
			view.setImg21("");
			view.setImg22("");
			view.setImg23("");
			view.setImg24("");
			view.setImg25("");
			view.setImg26("");
			view.setImg27("");
			view.setImg28("");
			view.setImg29("");
			view.setImg30("");
			view.setImg31("");
			view.setImg32("");
			view.setImg33("");
			view.setImg34("");
			
			topView.setImg1("");
			topView.setImg2("");
			topView.setImg3("");
			topView.setImg4("");
			topView.setImg5("");
			topView.setImg6("");
			topView.setImg7("");
			topView.setImg8("");
			topView.setImg9("");
			topView.setImg10("");
			topView.setImg11("");
			topView.setImg12("");
			topView.setImg13("");
			topView.setImg14("");
			topView.setImg15("");
			topView.setImg16("");
			topView.setImg17("");
			topView.setImg18("");
			topView.setImg19("");
			topView.setImg20("");
			topView.setImg21("");
			topView.setImg22("");
			topView.setImg23("");
			topView.setImg24("");
			topView.setImg25("");
			topView.setImg26("");
			topView.setImg27("");
			topView.setImg28("");
			topView.setImg29("");
			topView.setImg30("");
			topView.setImg31("");
			topView.setImg32("");
			topView.setImg33("");
			topView.setImg34("");
		}
		
		//根据位置跳转到不同的页面
		if(position.equals("1"))
		{
			/******** 事故项检查 ************/
			view.setBodyChk1(transStr(seniorDetectForm.getBodyChk1()));
			view.setBodyChk2(transStr(seniorDetectForm.getBodyChk2()));
			view.setBodyChk3(transStr(seniorDetectForm.getBodyChk3()));
			view.setBodyChk4(transStr(seniorDetectForm.getBodyChk4()));
			view.setBodyChk5(transStr(seniorDetectForm.getBodyChk5()));
			view.setBodyChk6(transStr(seniorDetectForm.getBodyChk6()));
			view.setBodyChk7(transStr(seniorDetectForm.getBodyChk7()));
			view.setBodyChk8(transStr(seniorDetectForm.getBodyChk8()));
			view.setBodyChk9(transStr(seniorDetectForm.getBodyChk9()));
			view.setBodyChk10(transStr(seniorDetectForm.getBodyChk10()));
			view.setBodyChk11(transStr(seniorDetectForm.getBodyChk11()));
			view.setBodyChk12(transStr(seniorDetectForm.getBodyChk12()));
			view.setBodyChk13(transStr(seniorDetectForm.getBodyChk13()));
		
			topView.setBodyChk1(transStr(seniorDetectForm.getBodyChk1()));
			topView.setBodyChk2(transStr(seniorDetectForm.getBodyChk2()));
			topView.setBodyChk3(transStr(seniorDetectForm.getBodyChk3()));
			topView.setBodyChk4(transStr(seniorDetectForm.getBodyChk4()));
			topView.setBodyChk5(transStr(seniorDetectForm.getBodyChk5()));
			topView.setBodyChk6(transStr(seniorDetectForm.getBodyChk6()));
			topView.setBodyChk7(transStr(seniorDetectForm.getBodyChk7()));
			topView.setBodyChk8(transStr(seniorDetectForm.getBodyChk8()));
			topView.setBodyChk9(transStr(seniorDetectForm.getBodyChk9()));
			topView.setBodyChk10(transStr(seniorDetectForm.getBodyChk10()));
			topView.setBodyChk11(transStr(seniorDetectForm.getBodyChk11()));
			topView.setBodyChk12(transStr(seniorDetectForm.getBodyChk12()));
			topView.setBodyChk13(transStr(seniorDetectForm.getBodyChk13()));
			/*********事故车，有一项选中则为事故车***********/

			if
			(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk1()))
			{
				topView.setTroubleCar(1);
			}	
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk2()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk3()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk4()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk5()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk6()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk7()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk8()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk9()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk10()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk11()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk12()))
			{
				topView.setTroubleCar(1);
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBodyChk13()))
			{
				topView.setTroubleCar(1);
			}
			uc.removeAttribute(DETECT_POSITION);
			uc.setAttribute(DETECT_POSITION, "1");
			
		}
		if(position.equals("2"))
		{
			/*********** 技术检测，车身外观检测 ***************/
			view.setOutwardChkS1(transStr(seniorDetectForm.getOutwardChkS1()));
			view.setOutwardChkS2(transStr(seniorDetectForm.getOutwardChkS2()));
			view.setOutwardChkS3(transStr(seniorDetectForm.getOutwardChkS3()));
			view.setOutwardChkS4(transStr(seniorDetectForm.getOutwardChkS4()));
			view.setOutwardChkS5(transStr(seniorDetectForm.getOutwardChkS5()));
			view.setOutwardChkS6(transStr(seniorDetectForm.getOutwardChkS6()));
			view.setOutwardChkS7(transStr(seniorDetectForm.getOutwardChkS7()));
			view.setOutwardChkS8(transStr(seniorDetectForm.getOutwardChkS8()));
			view.setOutwardChkS9(transStr(seniorDetectForm.getOutwardChkS9()));
			view.setOutwardChkS10(transStr(seniorDetectForm.getOutwardChkS10()));
			view.setOutwardChkS11(transStr(seniorDetectForm.getOutwardChkS11()));
			view.setOutwardChkS12(transStr(seniorDetectForm.getOutwardChkS12()));
			view.setOutwardChkS13(transStr(seniorDetectForm.getOutwardChkS13()));
			view.setOutwardChkS14(transStr(seniorDetectForm.getOutwardChkS14()));
			view.setOutwardChkS15(transStr(seniorDetectForm.getOutwardChkS15()));
			view.setOutwardChkS16(transStr(seniorDetectForm.getOutwardChkS16()));
			view.setOutwardChkS17(transStr(seniorDetectForm.getOutwardChkS17()));
			view.setOutwardChkS18(transStr(seniorDetectForm.getOutwardChkS18()));
			view.setOutwardChkS19(transStr(seniorDetectForm.getOutwardChkS19()));
			view.setOutwardChkS20(transStr(seniorDetectForm.getOutwardChkS20()));
			view.setOutwardChkS21(transStr(seniorDetectForm.getOutwardChkS21()));
			view.setOutwardChkS22(transStr(seniorDetectForm.getOutwardChkS22()));
			view.setOutwardChkS23(transStr(seniorDetectForm.getOutwardChkS23()));
			view.setOutwardChkS24(transStr(seniorDetectForm.getOutwardChkS24()));
			view.setOutwardChkS25(transStr(seniorDetectForm.getOutwardChkS25()));
			
			view.setOutwardChkC1(transStr(seniorDetectForm.getOutwardChkC1()));
			view.setOutwardChkC2(transStr(seniorDetectForm.getOutwardChkC2()));
			view.setOutwardChkC3(transStr(seniorDetectForm.getOutwardChkC3()));
			view.setOutwardChkC4(transStr(seniorDetectForm.getOutwardChkC4()));
			view.setOutwardChkC5(transStr(seniorDetectForm.getOutwardChkC5()));
			view.setOutwardChkC6(transStr(seniorDetectForm.getOutwardChkC6()));
			view.setOutwardChkC7(transStr(seniorDetectForm.getOutwardChkC7()));
			view.setOutwardChkC8(transStr(seniorDetectForm.getOutwardChkC8()));
			view.setOutwardChkC9(transStr(seniorDetectForm.getOutwardChkC9()));
			view.setOutwardChkC10(transStr(seniorDetectForm.getOutwardChkC10()));
			view.setOutwardChkC11(transStr(seniorDetectForm.getOutwardChkC11()));
			view.setOutwardChkC12(transStr(seniorDetectForm.getOutwardChkC12()));
			view.setOutwardChkC13(transStr(seniorDetectForm.getOutwardChkC13()));
			view.setOutwardChkC14(transStr(seniorDetectForm.getOutwardChkC14()));
			view.setOutwardChkC15(transStr(seniorDetectForm.getOutwardChkC15()));
			view.setOutwardChkC16(transStr(seniorDetectForm.getOutwardChkC16()));
			view.setOutwardChkC17(transStr(seniorDetectForm.getOutwardChkC17()));
			view.setOutwardChkC18(transStr(seniorDetectForm.getOutwardChkC18()));
			view.setOutwardChkC19(transStr(seniorDetectForm.getOutwardChkC19()));
			view.setOutwardChkC20(transStr(seniorDetectForm.getOutwardChkC20()));
			view.setOutwardChkC21(transStr(seniorDetectForm.getOutwardChkC21()));
			view.setOutwardChkC22(transStr(seniorDetectForm.getOutwardChkC22()));
			view.setOutwardChkC23(transStr(seniorDetectForm.getOutwardChkC23()));
			view.setOutwardChkC24(transStr(seniorDetectForm.getOutwardChkC24()));
			view.setOutwardChkC25(transStr(seniorDetectForm.getOutwardChkC25()));
			view.setOutwardChkC26(transStr(seniorDetectForm.getOutwardChkC26()));
			
			//四个程度1：0.5 2：1 3：1.5 4 只有轮胎扣一分

			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC1()))
			{
				if(seniorDetectForm.getOutwardChkC1().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC1().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC1().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC2()))
			{
				if(seniorDetectForm.getOutwardChkC2().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC2().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC2().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC3()))
			{
				if(seniorDetectForm.getOutwardChkC3().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC3().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC3().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC4()))
			{
				if(seniorDetectForm.getOutwardChkC4().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC4().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC4().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC5()))
			{
				if(seniorDetectForm.getOutwardChkC5().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC5().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC5().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC6()))
			{
				if(seniorDetectForm.getOutwardChkC6().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC6().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC6().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC7()))
			{
				if(seniorDetectForm.getOutwardChkC7().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC7().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC7().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC8()))
			{
				if(seniorDetectForm.getOutwardChkC8().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC8().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC8().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC9()))
			{
				if(seniorDetectForm.getOutwardChkC9().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC9().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC9().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC10()))
			{
				if(seniorDetectForm.getOutwardChkC10().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC10().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC10().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC11()))
			{
				if(seniorDetectForm.getOutwardChkC11().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC11().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC11().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC12()))
			{
				if(seniorDetectForm.getOutwardChkC12().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC12().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC12().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC13()))
			{
				if(seniorDetectForm.getOutwardChkC13().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC13().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC13().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC14()))
			{
				if(seniorDetectForm.getOutwardChkC14().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC14().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC14().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC15()))
			{
				if(seniorDetectForm.getOutwardChkC15().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC15().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC15().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC16()))
			{
				if(seniorDetectForm.getOutwardChkC16().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC16().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC16().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC17()))
			{
				if(seniorDetectForm.getOutwardChkC17().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC17().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC17().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC18()))
			{
				if(seniorDetectForm.getOutwardChkC18().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC18().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC18().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC19()))
			{
				if(seniorDetectForm.getOutwardChkC19().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC19().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC19().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC20()))
			{
				if(seniorDetectForm.getOutwardChkC20().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC20().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC20().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC21()))
			{
				if(seniorDetectForm.getOutwardChkC21().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC21().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC21().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC22()))
			{
				if(seniorDetectForm.getOutwardChkC22().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC22().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC22().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC23()))
			{
				if(seniorDetectForm.getOutwardChkC23().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC23().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC23().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC24()))
			{
				if(seniorDetectForm.getOutwardChkC24().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC24().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC24().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC25()))
			{
				if(seniorDetectForm.getOutwardChkC25().equals("1"))
				{
					if((outwardScore - 0.5) >= 0 )
					{
						outwardScore = outwardScore - 0.5;
					}
				}
				if(seniorDetectForm.getOutwardChkC25().equals("2"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
				if(seniorDetectForm.getOutwardChkC25().equals("3"))
				{
					if((outwardScore - 1.5) >= 0 )
					{
						outwardScore = outwardScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getOutwardChkC26()))
			{
				if(seniorDetectForm.getOutwardChkC26().equals("4"))
				{
					if((outwardScore - 1) >= 0 )
					{
						outwardScore = outwardScore - 1;
					}
				}
			}
			

			topView.setOutwardChk1(getdetectStr(seniorDetectForm.getOutwardChkS1(),seniorDetectForm.getOutwardChkC1()));
			topView.setOutwardChk2(getdetectStr(seniorDetectForm.getOutwardChkS2(),seniorDetectForm.getOutwardChkC2()));
			topView.setOutwardChk3(getdetectStr(seniorDetectForm.getOutwardChkS3(),seniorDetectForm.getOutwardChkC3()));
			topView.setOutwardChk4(getdetectStr(seniorDetectForm.getOutwardChkS4(),seniorDetectForm.getOutwardChkC4()));
			topView.setOutwardChk5(getdetectStr(seniorDetectForm.getOutwardChkS5(),seniorDetectForm.getOutwardChkC5()));
			topView.setOutwardChk6(getdetectStr(seniorDetectForm.getOutwardChkS6(),seniorDetectForm.getOutwardChkC6()));
			topView.setOutwardChk7(getdetectStr(seniorDetectForm.getOutwardChkS7(),seniorDetectForm.getOutwardChkC7()));
			topView.setOutwardChk8(getdetectStr(seniorDetectForm.getOutwardChkS8(),seniorDetectForm.getOutwardChkC8()));
			topView.setOutwardChk9(getdetectStr(seniorDetectForm.getOutwardChkS9(),seniorDetectForm.getOutwardChkC9()));
			topView.setOutwardChk10(getdetectStr(seniorDetectForm.getOutwardChkS10(),seniorDetectForm.getOutwardChkC10()));
			topView.setOutwardChk11(getdetectStr(seniorDetectForm.getOutwardChkS11(),seniorDetectForm.getOutwardChkC11()));
			topView.setOutwardChk12(getdetectStr(seniorDetectForm.getOutwardChkS12(),seniorDetectForm.getOutwardChkC12()));
			topView.setOutwardChk13(getdetectStr(seniorDetectForm.getOutwardChkS13(),seniorDetectForm.getOutwardChkC13()));
			topView.setOutwardChk14(getdetectStr(seniorDetectForm.getOutwardChkS14(),seniorDetectForm.getOutwardChkC14()));
			topView.setOutwardChk15(getdetectStr(seniorDetectForm.getOutwardChkS15(),seniorDetectForm.getOutwardChkC15()));
			topView.setOutwardChk16(getdetectStr(seniorDetectForm.getOutwardChkS16(),seniorDetectForm.getOutwardChkC16()));
			topView.setOutwardChk17(getdetectStr(seniorDetectForm.getOutwardChkS17(),seniorDetectForm.getOutwardChkC17()));
			topView.setOutwardChk18(getdetectStr(seniorDetectForm.getOutwardChkS18(),seniorDetectForm.getOutwardChkC18()));
			topView.setOutwardChk19(getdetectStr(seniorDetectForm.getOutwardChkS19(),seniorDetectForm.getOutwardChkC19()));
			topView.setOutwardChk20(getdetectStr(seniorDetectForm.getOutwardChkS20(),seniorDetectForm.getOutwardChkC20()));
			topView.setOutwardChk21(getdetectStr(seniorDetectForm.getOutwardChkS21(),seniorDetectForm.getOutwardChkC21()));
			topView.setOutwardChk22(getdetectStr(seniorDetectForm.getOutwardChkS22(),seniorDetectForm.getOutwardChkC22()));
			topView.setOutwardChk23(getdetectStr(seniorDetectForm.getOutwardChkS23(),seniorDetectForm.getOutwardChkC23()));
			topView.setOutwardChk24(getdetectStr(seniorDetectForm.getOutwardChkS24(),seniorDetectForm.getOutwardChkC24()));
			topView.setOutwardChk25(getdetectStr(seniorDetectForm.getOutwardChkS25(),seniorDetectForm.getOutwardChkC25()));
			topView.setOutwardChk26(seniorDetectForm.getOutwardChkC26());	//轮胎只有一个程度,没有缺陷描述		
		
			uc.removeAttribute(DETECT_POSITION);
			actionForward = "position2";
			uc.setAttribute(DETECT_POSITION, "2");
		}
		if(position.equals("3"))
		{
			/*********** 技术检测，发动机舱检测 ***************/
			view.setEngineChk1(seniorDetectForm.getEngineChk1());
			view.setEngineChk2(seniorDetectForm.getEngineChk2());
			view.setEngineChk3(seniorDetectForm.getEngineChk3());
			view.setEngineChk4(seniorDetectForm.getEngineChk4());
			view.setEngineChk5(seniorDetectForm.getEngineChk5());
			view.setEngineChk6(seniorDetectForm.getEngineChk6());
			view.setEngineChk7(seniorDetectForm.getEngineChk7());
			view.setEngineChk8(seniorDetectForm.getEngineChk8());
			view.setEngineChk9(seniorDetectForm.getEngineChk9());

			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk1()))
			{
				if(seniorDetectForm.getEngineChk1().equals("轻微"))
				{
					if((engineScore - 15) >= 0)
					{
						engineScore = engineScore - 15;
					}
				}
				if(seniorDetectForm.getEngineChk1().equals("严重")){
					if((engineScore - 15) >= 0)
					{
						engineScore = engineScore - 15;
					}
				}
			}

			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk2()))
			{
				if(seniorDetectForm.getEngineChk2().equals("轻微")){
					if((engineScore - 5) >= 0)
					{
						engineScore = engineScore - 5;
					}
				}
				if(seniorDetectForm.getEngineChk2().equals("严重")){
						if((engineScore - 5)>=  0)
						{
							engineScore = engineScore - 5;
						}
					}
			}
//			前翼子板内缘、水箱框架、		不扣分	扣1.5分	扣3分
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk3()))
			{
				if(seniorDetectForm.getEngineChk3().equals("轻微"))
				{
					if((engineScore - 1.5) >= 0)
					{
						engineScore = engineScore - 1.5;
					}
				}if(seniorDetectForm.getEngineChk3().equals("严重")){
					if((engineScore - 3) >= 0)
					{
						engineScore = engineScore - 3;
					}
				}
			}
//			横拉梁有无凹凸或修复痕迹		不扣分	扣1.5分	扣3分
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk4()))
			{
				if(seniorDetectForm.getEngineChk4().equals("轻微"))
				{
					if((engineScore - 1.5) >= 0)
					{
						engineScore = engineScore - 1.5;
					}
				}if(seniorDetectForm.getEngineChk4().equals("严重")){
					if((engineScore - 3) >= 0)
					{
						engineScore = engineScore - 3;
					}
				}
			}
//			散热器格栅有无破损			不扣分	扣1.5分	扣3分
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk5()))
			{
				if(seniorDetectForm.getEngineChk5().equals("轻微"))
				{
					if((engineScore - 1.5) >= 0)
					{
						engineScore = engineScore - 1.5;
					}
				}if(seniorDetectForm.getEngineChk5().equals("严重")){
					if((engineScore - 3) >= 0)
					{
						engineScore = engineScore - 3;
					}
				}
			}
//			蓄电池电极桩柱有无腐蚀		不扣分	扣2分	扣4分
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk6()))
			{
				if(seniorDetectForm.getEngineChk6().equals("轻微"))
				{
					if((engineScore - 2) >= 0)
					{
						engineScore = engineScore - 2;
					}
				}if(seniorDetectForm.getEngineChk6().equals("严重")){
					if((engineScore - 4) >= 0)
					{
						engineScore = engineScore - 4;
					}
				}
			}
//			蓄电池电解液有无渗漏、缺少	不扣分	扣1.5分	扣3分
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk7()))
			{
				if(seniorDetectForm.getEngineChk7().equals("轻微"))
				{
					if((engineScore - 1.5) >= 0)
					{
						engineScore = engineScore - 1.5;
					}
				}if(seniorDetectForm.getEngineChk7().equals("严重")){
					if((engineScore - 3) >= 0)
					{
						engineScore = engineScore - 3;
					}
				}
			}
//			发动机皮带有无老化			不扣分	扣1.5分	扣3分
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk8()))
			{
				if(seniorDetectForm.getEngineChk8().equals("轻微"))
				{
					if((engineScore - 1.5) >= 0)
					{
						engineScore = engineScore - 1.5;
					}
				}if(seniorDetectForm.getEngineChk8().equals("严重")){
					if((engineScore - 3) >= 0)
					{
						engineScore = engineScore - 3;
					}
				}
			}
//			油管、水管有无老化、裂痕		不扣分	扣1.5分	扣3分
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getEngineChk9()))
			{
				if(seniorDetectForm.getEngineChk9().equals("轻微"))
				{
					if((engineScore - 1.5) >= 0)
					{
						engineScore = engineScore - 1.5;
					}
				}if(seniorDetectForm.getEngineChk9().equals("严重")){
					if((engineScore - 3) >= 0)
					{
						engineScore = engineScore - 3;
					}
				}
			}
			
			topView.setEngineChk1(seniorDetectForm.getEngineChk1());
			topView.setEngineChk2(seniorDetectForm.getEngineChk2());
			topView.setEngineChk3(seniorDetectForm.getEngineChk3());
			topView.setEngineChk4(seniorDetectForm.getEngineChk4());
			topView.setEngineChk5(seniorDetectForm.getEngineChk5());
			topView.setEngineChk6(seniorDetectForm.getEngineChk6());
			topView.setEngineChk7(seniorDetectForm.getEngineChk7());
			topView.setEngineChk8(seniorDetectForm.getEngineChk8());
			topView.setEngineChk9(seniorDetectForm.getEngineChk9());

			uc.removeAttribute(DETECT_POSITION);
			actionForward = "position3";
			uc.setAttribute(DETECT_POSITION, "3");
		}
		if(position.equals("4"))
		{
			/*********** 技术检测，驾驶舱检测 ***************/
			view.setPilotChk1(seniorDetectForm.getPilotChk1());
			view.setPilotChk2(seniorDetectForm.getPilotChk2());
			view.setPilotChk3(seniorDetectForm.getPilotChk3());
			view.setPilotChk4(seniorDetectForm.getPilotChk4());
			view.setPilotChk5(seniorDetectForm.getPilotChk5());
			view.setPilotChk6(seniorDetectForm.getPilotChk6());
			view.setPilotChk7(seniorDetectForm.getPilotChk7());
			view.setPilotChk8(seniorDetectForm.getPilotChk8());
			view.setPilotChk9(seniorDetectForm.getPilotChk9());
			view.setPilotChk10(seniorDetectForm.getPilotChk10());
			view.setPilotChk11(seniorDetectForm.getPilotChk11());
			view.setPilotChk12(seniorDetectForm.getPilotChk12());
			view.setPilotChk13(seniorDetectForm.getPilotChk13());
			view.setPilotChk14(seniorDetectForm.getPilotChk14());

			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk1()))
			{
				if(seniorDetectForm.getPilotChk1().equals("否"))
				{
					if((pilotScore - 1.5) >= 0)
					{
						pilotScore = pilotScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk2()))
			{
				if(seniorDetectForm.getPilotChk2().equals("否"))
				{
					if((pilotScore - 1.5) >= 0)
					{
						pilotScore = pilotScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk3()))
			{
				if(seniorDetectForm.getPilotChk3().equals("否"))
				{
					if((pilotScore - 1.5) >= 0)
					{
						pilotScore = pilotScore - 1.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk4()))
			{
				if(seniorDetectForm.getPilotChk4().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk5()))
			{
				if(seniorDetectForm.getPilotChk5().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk6()))
			{
				if(seniorDetectForm.getPilotChk6().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk7()))
			{
				if(seniorDetectForm.getPilotChk7().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk8()))
			{
				if(seniorDetectForm.getPilotChk8().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk9()))
			{
				if(seniorDetectForm.getPilotChk9().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk10()))
			{
				if(seniorDetectForm.getPilotChk10().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk11()))
			{
				if(seniorDetectForm.getPilotChk11().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk12()))
			{
				if(seniorDetectForm.getPilotChk12().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk13()))
			{
				if(seniorDetectForm.getPilotChk13().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getPilotChk14()))
			{
				if(seniorDetectForm.getPilotChk14().equals("否"))
				{
					if((pilotScore - 1) >= 0)
					{
						pilotScore = pilotScore - 1;
					}
				}
			}

			
			topView.setPilotChk1(seniorDetectForm.getPilotChk1());
			topView.setPilotChk2(seniorDetectForm.getPilotChk2());
			topView.setPilotChk3(seniorDetectForm.getPilotChk3());
			topView.setPilotChk4(seniorDetectForm.getPilotChk4());
			topView.setPilotChk5(seniorDetectForm.getPilotChk5());
			topView.setPilotChk6(seniorDetectForm.getPilotChk6());
			topView.setPilotChk7(seniorDetectForm.getPilotChk7());
			topView.setPilotChk8(seniorDetectForm.getPilotChk8());
			topView.setPilotChk9(seniorDetectForm.getPilotChk9());
			topView.setPilotChk10(seniorDetectForm.getPilotChk10());
			topView.setPilotChk11(seniorDetectForm.getPilotChk11());
			topView.setPilotChk12(seniorDetectForm.getPilotChk12());
			topView.setPilotChk13(seniorDetectForm.getPilotChk13());
			topView.setPilotChk14(seniorDetectForm.getPilotChk14());

			uc.removeAttribute(DETECT_POSITION);
			actionForward = "position4";
			uc.setAttribute(DETECT_POSITION, "4");
		}
		if(position.equals("5"))
		{
			/*********** 技术检测，启动检测 ***************/
			view.setStartChk1(seniorDetectForm.getStartChk1());
			view.setStartChk2(seniorDetectForm.getStartChk2());
			view.setStartChk3(seniorDetectForm.getStartChk3());
			view.setStartChk4(seniorDetectForm.getStartChk4());
			view.setStartChk5(seniorDetectForm.getStartChk5());
			view.setStartChk6(seniorDetectForm.getStartChk6());
			view.setStartChk7(seniorDetectForm.getStartChk7());
			view.setStartChk8(seniorDetectForm.getStartChk8());
			view.setStartChk9(seniorDetectForm.getStartChk9());

			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk1()))
			{
				if(seniorDetectForm.getStartChk1().equals("否"))
				{
					if((startScore - 2) >= 0)
					{
						startScore = startScore - 2;
					}
				}
			}	
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk2()))
			{
				if(seniorDetectForm.getStartChk2().equals("否"))
				{
					if((startScore - 2) >= 0)
					{
						startScore = startScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk3()))
			{
				if(seniorDetectForm.getStartChk3().equals("否"))
				{
					if((startScore - 1) >= 0)
					{
						startScore = startScore - 1;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk4()))
			{
				if(seniorDetectForm.getStartChk4().equals("否"))
				{
					if((startScore - 0.5) >= 0)
					{
						startScore = startScore - 0.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk5()))
			{
				if(seniorDetectForm.getStartChk5().equals("否"))
				{
					if((startScore - 0.5) >= 0)
					{
						startScore = startScore - 0.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk6()))
			{
				if(seniorDetectForm.getStartChk6().equals("否"))
				{
					if((startScore - 0.5) >= 0)
					{
						startScore = startScore - 0.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk7()))
			{
				if(seniorDetectForm.getStartChk7().equals("否"))
				{
					if((startScore - 0.5) >= 0)
					{
						startScore = startScore - 0.5;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk8()))
			{
				if(seniorDetectForm.getStartChk8().equals("否"))
				{
					if((startScore - 10) >= 0)
					{
						startScore = startScore - 10;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getStartChk9()))
			{
				if(seniorDetectForm.getStartChk9().equals("否"))
				{
					if((startScore - 10) >= 0)
					{
						startScore = startScore - 10;
					}
				}
			}
	
			topView.setStartChk1(seniorDetectForm.getStartChk1());
			topView.setStartChk2(seniorDetectForm.getStartChk2());
			topView.setStartChk3(seniorDetectForm.getStartChk3());
			topView.setStartChk4(seniorDetectForm.getStartChk4());
			topView.setStartChk5(seniorDetectForm.getStartChk5());
			topView.setStartChk6(seniorDetectForm.getStartChk6());
			topView.setStartChk7(seniorDetectForm.getStartChk7());
			topView.setStartChk8(seniorDetectForm.getStartChk8());
			topView.setStartChk9(seniorDetectForm.getStartChk9());
			
			uc.removeAttribute(DETECT_POSITION);
			actionForward = "position5";
			uc.setAttribute(DETECT_POSITION, "5");
		}
		if(position.equals("6"))
		{
			/*********** 技术检测，路试检测 ***************/
			view.setRunChk1(seniorDetectForm.getRunChk1());
			view.setRunChk2(seniorDetectForm.getRunChk2());
			view.setRunChk3(seniorDetectForm.getRunChk3());
			view.setRunChk4(seniorDetectForm.getRunChk4());
			view.setRunChk5(seniorDetectForm.getRunChk5());
			view.setRunChk6(seniorDetectForm.getRunChk6());
			view.setRunChk7(seniorDetectForm.getRunChk7());
			view.setRunChk8(seniorDetectForm.getRunChk8());
			view.setRunChk9(seniorDetectForm.getRunChk9());

			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk1()))
			{
				if(seniorDetectForm.getRunChk1().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk2()))
			{
				if(seniorDetectForm.getRunChk2().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk3()))
			{
				if(seniorDetectForm.getRunChk3().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk4()))
			{
				if(seniorDetectForm.getRunChk4().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk5()))
			{
				if(seniorDetectForm.getRunChk5().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk6()))
			{
				if(seniorDetectForm.getRunChk6().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk7()))
			{
				if(seniorDetectForm.getRunChk7().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk8()))
			{
				if(seniorDetectForm.getRunChk8().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getRunChk9()))
			{
				if(seniorDetectForm.getRunChk9().equals("否"))
				{
					if((runScore - 2) >= 0)
					{
						runScore = runScore - 2;
					}
				}
			}
			topView.setRunChk1(seniorDetectForm.getRunChk1());
			topView.setRunChk2(seniorDetectForm.getRunChk2());
			topView.setRunChk3(seniorDetectForm.getRunChk3());
			topView.setRunChk4(seniorDetectForm.getRunChk4());
			topView.setRunChk5(seniorDetectForm.getRunChk5());
			topView.setRunChk6(seniorDetectForm.getRunChk6());
			topView.setRunChk7(seniorDetectForm.getRunChk7());
			topView.setRunChk8(seniorDetectForm.getRunChk8());
			topView.setRunChk9(seniorDetectForm.getRunChk9());
	
			uc.removeAttribute(DETECT_POSITION);
			actionForward = "position6";
			uc.setAttribute(DETECT_POSITION, "6");
		}
		if(position.equals("7"))
		{
			/*********** 技术检测，底盘检测 ***************/
			view.setBottomChk1(seniorDetectForm.getBottomChk1());
			view.setBottomChk2(seniorDetectForm.getBottomChk2());
			view.setBottomChk3(seniorDetectForm.getBottomChk3());
			view.setBottomChk4(seniorDetectForm.getBottomChk4());
			view.setBottomChk5(seniorDetectForm.getBottomChk5());
			view.setBottomChk6(seniorDetectForm.getBottomChk6());
			view.setBottomChk7(seniorDetectForm.getBottomChk7());

			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBottomChk1()))
			{
				if(seniorDetectForm.getBottomChk1().equals("否"))
				{
					if((bottomScore - 4) >= 0)
					{
						bottomScore = bottomScore - 4;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBottomChk2()))
			{
				if(seniorDetectForm.getBottomChk2().equals("否"))
				{
					if((bottomScore - 4) >= 0)
					{
						bottomScore = bottomScore - 4;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBottomChk3()))
			{
				if(seniorDetectForm.getBottomChk3().equals("否"))
				{
					if((bottomScore - 3) >= 0)
					{
						bottomScore = bottomScore - 3;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBottomChk4()))
			{
				if(seniorDetectForm.getBottomChk4().equals("否"))
				{
					if((bottomScore - 3) >= 0)
					{
						bottomScore = bottomScore - 3;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBottomChk5()))
			{
				if(seniorDetectForm.getBottomChk5().equals("否"))
				{
					if((bottomScore - 2) >= 0)
					{
						bottomScore = bottomScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBottomChk6()))
			{
				if(seniorDetectForm.getBottomChk6().equals("否"))
				{
					if((bottomScore - 2) >= 0)
					{
						bottomScore = bottomScore - 2;
					}
				}
			}
			if(!StringUtil.isNullOrBlank(seniorDetectForm.getBottomChk7()))
			{
				if(seniorDetectForm.getBottomChk7().equals("否"))
				{
					if((bottomScore - 2) >= 0)
					{
						bottomScore = bottomScore - 2;
					}
				}
			}
	
			topView.setBottomChk1(seniorDetectForm.getBottomChk1());
			topView.setBottomChk2(seniorDetectForm.getBottomChk2());
			topView.setBottomChk3(seniorDetectForm.getBottomChk3());
			topView.setBottomChk4(seniorDetectForm.getBottomChk4());
			topView.setBottomChk5(seniorDetectForm.getBottomChk5());
			topView.setBottomChk6(seniorDetectForm.getBottomChk6());
			topView.setBottomChk7(seniorDetectForm.getBottomChk7());


			uc.removeAttribute(DETECT_POSITION);
			actionForward = "position7";
			uc.setAttribute(DETECT_POSITION, "7");
		}
		if(position.equals("8"))
		{
			//八、检测说明录入
			view.setCarDescribe(seniorDetectForm.getCarDescribe());
			topView.setCarDescribe(seniorDetectForm.getCarDescribe());
			uc.removeAttribute(DETECT_POSITION);
			actionForward = "position8";
			uc.setAttribute(DETECT_POSITION, "8");
		}

		/**评分**/
		topView.setOutwardScore(outwardScore);
		topView.setEngineScore(engineScore);
		topView.setPilotScore(pilotScore);
		topView.setStartScore(startScore);
		topView.setRunScore(runScore);
		topView.setBottomScore(bottomScore);
		view.setCarSerial((String)uc.getAttribute(CARSERIAL));
		request.setAttribute(TmsConstants.VIEWHELP, view);
		
		uc.setAttribute(SENIOR_DETECT_INPUT_DATA, topView);//将检测信息set到uc中带进入首页时查看
		logger.debug(this.getClass().getName() + "#doAction was completed.");
		return mapping.findForward(TmsConstants.SUCCESS);
	}

	private String transStr(String str)
	{
		if("".equals(str)||str == null)
		{
			return "-";
		}
		
		return str;
	}
	
	/**
	 * 
	 * 合并字符串，放到首页检测报告录入中
	 */
	private String getdetectStr(String decName,String decLevel)
	{
		String str = "-";
		if(!"".equals(StringUtil.isNULL(decName))&&!"".equals(StringUtil.isNULL(decLevel)))
		{
			//如果都不为空,缺陷+程度
			return (decName+decLevel);
		}
		if("".equals(StringUtil.isNULL(decName))&& "".equals(StringUtil.isNULL(decLevel)))
		{
			//同时为空，则返回"-"
			return str;
		}
		if(!"".equals(StringUtil.isNULL(decName)))
		{
			//如果缺陷名字不为空，则返回缺陷名
			return decName;
		}
		return str;
	}

}
